//
//  ZCMVUpdataCollectionViewCell.m
//  VoiceMusic
//
//  Created by dllo on 15/10/20.
//  Copyright © 2015年 zhangdeyu. All rights reserved.
//

#import "ZCMVUpdataCollectionViewCell.h"
#import <Masonry.h>
#import <UIImageView+WebCache.h>
#import "ZCBaseLabel.h"
@implementation ZCMVUpdataCollectionViewCell


-(void)layoutSubviews
{
    [super layoutSubviews];

    [self.picImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(0);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-30);
        make.right.left.equalTo(self.contentView).offset(0);
    }];
    self.picImageView.layer.cornerRadius = 10;
    self.picImageView.layer.masksToBounds = YES;

    [self.firstLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.equalTo(self.contentView).offset(0);
        make.bottom.equalTo(self.picImageView.mas_bottom).offset(0);
        make.height.equalTo(@20);
    }];
    self.firstLabel.alpha = 0.7;
    [self.firstLabel setBackgroundColor:[UIColor blackColor]];
    [self.firstLabel setTextColor:[UIColor whiteColor]];
    [self.firstLabel setFont:[UIFont boldSystemFontOfSize:22]];
    self.firstLabel.layer.cornerRadius = 10;
    self.firstLabel.layer.masksToBounds = YES;


    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.picImageView.mas_bottom).offset(0);
        make.bottom.equalTo(self.contentView).offset(0);
        make.right.left.equalTo(self.contentView).offset(0);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(0);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.iconImageView);
    }];
    [self.titleLabel setTextColor:[UIColor whiteColor]];
    [self.titleLabel setFont:[UIFont boldSystemFontOfSize:18]];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    
}

//}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)getInfo:(ZCMVModel *)model
{
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.picUrl] placeholderImage:[UIImage imageNamed:@"50.png"]];
    [self.firstLabel setText:model.singerName];
    [self.titleLabel setText:model.videoName];
    [self.iconImageView setImage:[UIImage imageNamed:@"1952"]];
}
@end
